import { MessageBox } from 'element-ui'

// 只有‘确定’按钮弹出框
export function cofirmBox(text, title,) {
  return MessageBox.confirm(`<p class="message">${text}</p>`, title, {
    customClass: 'confirmClass',
    confirmButtonText: '确定',
    showCancelButton: false,
    center: true,
    dangerouslyUseHTMLString: true
    // type : 'warning'
  })
}

// 成功弹出框
export function successBox(text, title) {
  return MessageBox.confirm(`<p class="message">${text}</p>`, title, {
    customClass: 'confirmClass',
    confirmButtonText: '确定',
    showCancelButton: false,
    center: true,
    dangerouslyUseHTMLString: true,
    type: 'success'
  })
}
// 失败弹出框
export function failBox(text, title) {
  return MessageBox.confirm(`<p class="message">${text}</p>`, title, {
    customClass: 'confirmClass',
    confirmButtonText: '确定',
    showCancelButton: false,
    center: true,
    dangerouslyUseHTMLString: true,
    type: 'error'
  })
}

// ‘确定’和‘取消’按钮都存在弹出框
export function warnBox(text, title,) {
  return MessageBox.confirm(`<p class="message">${text}</p>`, title, {
    customClass: 'confirmClass',
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    confirmButtonClass: 'btn-custom-confirm',
    cancelButtonClass: 'btn-custom-cancel',
    center: true,
    dangerouslyUseHTMLString: true,
    type: 'warning'
  })
}
